﻿@{ Layout = null;
    var lstItems = jService.GetAll();
}

@model JobFunctionEntity
@inject IJobGradeService jService
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">岗位编辑</h4>
</div>
<div class="modal-body">
    <div class="ibox float-e-margins">
        <div class="ibox-content text-center p-md">
            <form id="job-dynamic-form"  asp-action="JobEdit" asp-controller="OrgChart" asp-area="Org" method="post" class="form-horizontal" role="form">
                <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                <input type="hidden" asp-for="JobFunctionId" />
                <input type="hidden" asp-for="DepartmentId" />
                <input type="hidden" asp-for="JobFunctionName" />
                <input type="hidden" asp-for="OrgId" />
                <input type="hidden" asp-for="ParentId" />
                <input type="hidden" asp-for="SourceName" />
                <div class="form-group">
                    <label asp-for="JobFunctionType" class="col-md-2 control-label text-right"> 类别</label>
                    <div class="col-md-10  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <select asp-for="JobFunctionType" class="select2 col-md-5">
                                <option value="0">岗位</option>
                                <option value="1">部门</option>
                            </select>
                        </div>
                        <span asp-validation-for="JobFunctionType" class="text-danger"></span>
                    </div>

                </div>
                <div class="JobFunctionInfo" style="display:@(Model.JobFunctionType==1?"none":"block")">
                    <div class="form-group">
                        <label class="col-md-2 control-label text-right"></label>
                        <div class="col-md-10 text-left">
                            <div class="i-checks ">
                                <label asp-for="IsPrimary"> <input tabindex="3" asp-for="IsPrimary" type="checkbox">是否主岗 </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label asp-for="JobGradeId" class="col-md-2 control-label text-right"> 职级名称 </label>
                        <div class="col-md-10  text-left">
                            <div class="input-group m-b">
                                <span class="input-group-addon"></span>
                                <select name="JobGradeId" id="JobGradeId" class="select2 col-md-5">
                                    <option value="">&nbsp;</option>
                                    @if (lstItems != null && lstItems.Count > 0)
                                    {
                                        foreach (var item in lstItems)
                                        {
                                            @Html.Raw("<option value=\"" + item.JobGradeId + "\">" + item.JobGradeName + "</option>")
                                        }
                                    }
                                </select>
                            </div>
                            <span asp-validation-for="JobGradeId" class="text-danger"></span>
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="SourceId" class="col-md-2 control-label text-right">用户</label>
                    <div class="col-md-10  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon"></span>
                            <select asp-for="SourceId" class="ajax-select col-md-5"></select>

                        </div>
                        <span asp-validation-for="SourceId" class="text-danger"></span>
                    </div>

                </div>
                <div class="form-group">
                    <label asp-for="OrderNum" class="col-md-2 control-label text-right"> 排序</label>
                    <div class="col-md-10  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <input asp-for="OrderNum" class="form-control" validate="{required:true}" />
                        </div>
                        <span asp-validation-for="OrderNum" class="text-danger"></span>
                    </div>

                </div>
                <div class="form-group">
                    <label asp-for="Remark" class="col-md-2 control-label text-right"> 备注</label>
                    <div class="col-md-10 text-left">
                        <textarea asp-for="Remark" tabindex="8" class="form-control" ltype="textarea" rows="5" style="width:100%;"></textarea>
                    </div>

                </div>
            </form>
        </div>
    </div>
</div>
<div class="modal-footer">

</div>
